<?
//ini_set('display_errors','On');
session_start ();
$ss = $_COOKIE ['SAMSsession'];

$sid = $_COOKIE ['HS7BDF'];

$name = substr ( $sid, 0, strpos ( $sid, "\\" ) );

$temp = substr ( $ss, 40 );

$temp1 = explode ( ".", $temp );

$temp1 = array_unique ( $temp1 );

$oucu = $temp1 [0];

$ssid = $temp1 [1];
$temp1[]='';
$isstudent = 'false';

if ($_SERVER ['HTTP_SAMS_STUDENTPI'])
	$isstudent = true;

if (! $ssid)
	$ssid = $temp1 [2];
$_SESSION ['oucu'] = $_SERVER ['HTTP_SAMS_USER'];
$_SESSION ['ssid'] = $_SERVER ['HTTP_SAMS_STAFFID'];
$_SESSION ['spi'] = $_SERVER ['HTTP_SAMS_STUDENTPI'];
$_SESSION ['stid'] = $_SERVER ['HTTP_SAMS_TUTORID'];
$_SESSION ['svid'] = $_SERVER ['HTTP_SAMS_VISITORID'];
$_SESSION ['sname'] = $_COOKIE ['HS7BDF'];
$_SESSION ['isstudent'] = $isstudent;
$_SESSION ['samstimecheck'] = mktime ();
//print_r($_SERVER);
header("location:".($_GET['url'])."?sams=".$_SESSION['samstimecheck']."&url=".$_GET['url']);
die("<a href='{$_GET['url']}?sams={$_SESSION['samstimecheck']}&url={$_GET['url']}'>click here</a>");

?>
